﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Lg.Core.DbHelper;
using Microsoft.Extensions.DependencyInjection;



namespace Lg.Core
{
    public static class Service
    {
        public static IServiceCollection AddJsonHelper(this IServiceCollection service)
        {
            return service.AddScoped<IJsonHelper,JsonHelper>();
        }

        public static IServiceCollection AddSqlHelper(this IServiceCollection service)
        {
            return service.AddScoped<IDBHelper,SqlHelper>();
        }

        public static IServiceCollection AddLgCore(this IServiceCollection service)
        {
            service.AddScoped<IJsonHelper, JsonHelper>();
            service.AddScoped<IDBHelper, SqlHelper>();
            service.AddTransient<RtMsg>(option =>
            {
                return new RtMsg() { code=100,msg="未知错误！"};
            });
            return service;

        }
        public static IServiceProvider? AppServers { get; set; }
    }
}
